from selenium import webdriver


# from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
# desired_capabilities = DesiredCapabilities.CHROME  # 修改页面加载策略
# desired_capabilities["pageLoadStrategy"] = "none"
# 以上三行 解决  Selenium 页面加载慢 https://blog.csdn.net/wkb342814892/article/details/81611737
chrome_options= webdriver.ChromeOptions()
# chrome_options.add_argument('--no-sandbox')#解决DevToolsActivePort文件不存在的报错
# chrome_options.add_argument('window-size=1920x3000') #指定浏览器分辨率
# chrome_options.add_argument('--disable-gpu') #谷歌文档提到需要加上这个属性来规避bug
# chrome_options.add_argument('--hide-scrollbars') #隐藏滚动条, 应对一些特殊页面
# chrome_options.add_argument('blink-settings=imagesEnabled=false') #不加载图片, 提升速度
# chrome_options.add_argument('--headless') #浏览器不提供可视化页面. linux下如果系统不支持可视化不加这条会启动失败
# browser = webdriver.Chrome("/root/note/Python/myTools/Scrapy/driver/chromedriver",chrome_options=chrome_options)
# browser.get("https://www.baidu.com")
# 注意 注意 这个地方是个坑  必须设置   否则可能招到老版本的浏览器
chrome_options.binary_location ="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" #手动指定使用的浏览器位置


# 在此地址下载与本机安装的chrome版本对应的driver.exe http://chromedriver.storage.googleapis.com/index.html?path=78.0.3904.11/
driver = webdriver.Chrome("E:\\python\\77.0.3865.40\\chromedriver.exe",chrome_options=chrome_options)
driver.maximize_window()
# driver = webdriver.Chrome()
 #本地开发首页地址
url = 'http://card.96bill.com/repay-web/login.do'

driver.get(url)
'''find_element_by_name 后跟name值，key为需要输入的数据'''
driver.find_element_by_name('phone').send_keys('13799848787')
driver.find_element_by_name('passWd').send_keys('13799848787')
# for i in range(10):
driver.find_element_by_class_name("m-b").click()
# 元素搜索 参考：https://blog.csdn.net/qq_38282706/article/details/80427959
print(driver.title)
print(driver.title)


#
# driver.execute_script("login()")
# driver.get('http://127.0.0.1:8080/default/com.guojingold.bpm.hcm.recruited.Main.flow')
#
# driver.execute_script("addRecord()")
#
# #表单数据
# #id为每个需填项的id，send_keys为自己要填进去的内容;
# driver.find_element_by_id('probasalary').send_keys('100')
# driver.find_element_by_id('formsalary').send_keys('100')
# driver.find_element_by_id('probadate').send_keys('100')
# driver.find_element_by_id('formmeal').send_keys('100')
# driver.find_element_by_id('formcom').send_keys('100')
# driver.find_element_by_id('formtraffic').send_keys('100')